import request from '@/utils/request'

const teacher_baseurl = '/serviceedu/teacher'

export default{
    //1 讲师列表(条件分页)
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            url: `${teacher_baseurl}/pageCondition/${current}/${limit}`,
            method: 'post',
            //teacherQuery条件对象，后端使用的是RequestBody，表示要json数据
            //data表示把对象转成json数据传递到接口
            data: teacherQuery
        })
    },
    //删除讲师
    removeById(id){
        return request({
            url: `${teacher_baseurl}/delete/${id}`,
            method: 'delete'
        })
    },
    //添加讲师
    save(teacher){
        return request({
            url: `${teacher_baseurl}/add`,
            method: 'post',
            data: teacher
        })
    },
    //根据id查询讲师
    getInfoById(id){
        return request({
            url: `${teacher_baseurl}/getById/${id}`,
            method: 'get'
        })
    },
    //根据id修改讲师
    updateById(teacher){
        return request({
            url: `${teacher_baseurl}/update`,
            method: 'post',
            data: teacher
        })
    }
}